const cloud = require('wx-server-sdk');

cloud.init({
  env: cloud.DYNAMIC_CURRENT_ENV
});
const db = cloud.database();

// 修改数据库信息云函数入口函数
exports.main = async (event, context) => {
  try { 
    return await db.collection('bill') .where(_.or([
      {
        xmjl_openid:_.eq( event.data.openid)
      },{
        gcs_openid:_.eq( event.data.openid)
      },{
        zjl_openid:_.eq( event.data.openid)
      },{
        cwjl_openid:_.eq( event.data.openid)
      }
    ])).get()
  } catch (e) {
    return {
      success: false,
      errMsg: e
    };
  }
};
